import _config from '@/common/config'

uni.$u.http.setConfig(defaultConfig => {
  defaultConfig.baseURL = `${_config.baseUrl}/api`.replace(/[^:](\/\/)/g, $ => $.substring(0, 2))
  return defaultConfig
})

module.exports = vm => {
  require('./requestInterceptors')(vm)
  require('./responseInterceptors')(vm)
}
